﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Collections;

namespace Pc_Vision.DAOFactorys
{
    public class DAOadmin : DbConnection
    {
        public void InsertAdmin(Model.Admin a)
        {
            
            string query = "INSERT INTO admin (Gebruikersnaam, Wachtwoord) VALUES ('" + a.Username + "','" + a.Password + "')";
            InsertDB(query);
        }

        public ArrayList GetAllAdmin()
        {
            string query = "SELECT * FROM admin";
            ArrayList arr = GetAllAdmins(query);
            return arr;
        }

        public void UpdateAdmin(Model.Admin a)
        {
            string query = "UPDATE admin SET Gebruikersnaam = '" + a.username + "', Wachtwoord = '" + a.password + "' WHERE Adminid = '" + a.id + "'";
            UpdateDB(query);
        }


    }
}